package qldc.pm.tiensu.action;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletContext;
import javax.portlet.PortletURL;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import qldc.pm.tiensu.constants.TienSuConstants;
import qldc.pm.tiensu.dto.CongViecBanGiaoDTO;
import qldc.pm.tiensu.model.BienBanBanGiaoHoSo;
import qldc.pm.tiensu.service.BienBanBanGiaoHoSoLocalServiceUtil;

import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.servlet.ServletResponseUtil;
import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.User;
import com.liferay.portal.util.PortalUtil;
import com.report.logic.Report;

public class BaoCaoThongKe {
	private static Log _log = LogFactoryUtil.getLog(BaoCaoThongKe.class);


	public void chonLoaiBaoCao(ActionRequest request,
			ActionResponse response) throws SystemException,
			PortalException {
		int selected = ParamUtil.getInteger(request, "loaiBCTK",0);
		String tab1 = TienSuConstants.DS_HO_GIA_DINH;
		switch (selected) {
		case 1:
			tab1 = TienSuConstants.DS_HO_GIA_DINH;
			break;
		case 2:
			tab1 = TienSuConstants.DS_TIEN_SU;
			break;
		case 3:
			tab1 = TienSuConstants.DS_XOA_AN_TICH;
			break;
		case 4:
			tab1 = TienSuConstants.DS_TRICH_LUC;
			break;
		case 5:
			tab1 = TienSuConstants.DS_CAN_XOA_AN_TICH;
			break;
		case 6:
			tab1 = TienSuConstants.THONG_KE_TONG_QUAT;
			break;
		case 7:
			tab1 = TienSuConstants.THONG_KE_YEU_CAU_TRICH_LUC;
			break;
		default:
			tab1 = TienSuConstants.DS_HO_GIA_DINH;
			break;
		}
		String redirect = ParamUtil.getString(request, "redirect","");
		if (redirect != null && redirect.length() > 0){
			redirect = redirect.replace("_tabs1=", "_tabs1="+ tab1);
			try {
				response.sendRedirect(redirect);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

	}
	
}
